﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

//选关面板
public class Panel_SelectLevel : MonoBehaviour
{
    private SaveManager saveManager;

    private Button[] btn_Levels;
    private void Awake() 
    {
        saveManager =  Service.Get<GameManager>().saveManager;
        btn_Levels = GetComponentsInChildren<Button>();    
    }
    private void OnEnable() 
    {
        int unlockIndex = saveManager.SaveData.UnlockSceneIndex;
        for (int i = 0; i < btn_Levels.Length; i++)
        {
            btn_Levels[i].interactable = unlockIndex - 1 >= i;
        }
    }
}
